// 题目三 练习1
// app.js
const { add } = require('lodash')
const fp = require('lodash/fp')
const { Maybe, Container } = require('./support')

let maybe = Maybe.of([5, 6, 1])

let ex1 = addend => {
    return array => {

        let result = []
        for(let i = 0; i < array.length; i++){
            const item = array[i]
            const newItem = fp.add(item, addend)
            result.push(newItem)
        }
        return result
    }
}

const result = maybe.map(ex1(2))._value // 加2
console.log(result) // [ 7, 8, 3 ]


